<?php
require_once 'db_conn.php';
header("content-type:text/html:charset=utf-8");
$conn;
$username = $_POST['username'];
$sex = $_POST['sex'];
$message = $_POST['message'];
$imgurl = $_POST['imgurl'];
$time_at = time();

$sql ="
    INSERT INTO `bbs`.`t_message` (
    `username` ,
    `sex` ,
    `content` ,
    `avater` ,
    `time_at`
)
VALUES (
 '$username', '$sex', '$message', '$imgurl','$time_at'
);
";

$result = $conn->query($sql);
if($result===FALSE){
    echo '0';
}
 /*else {
    echo '1';    
}*/
header("location:index.php");
?>
        
